﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QAManager.ascx.cs" Inherits="CMS.Controls.QA.QAManager" %>
<%@ Import Namespace="Core.Library" %>
<%@ Import Namespace="DataObject.QA" %>

<asp:HiddenField ID="hfTab" runat="server"/>
<asp:HiddenField ID="hfIsActive" runat="server"/>

<div class="stats">
    <ul>
        <li><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsPublished.ToString()) %>"><%= Publish %></a><span>Đã duyệt</span></li>                
        <li><a title="" class="count orange" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsWaitingForPublish.ToString()) %>"><%= WaitingForPublish %></a><span>Chờ duyệt</span></li>      
    </ul>
    <div class="fix"></div>
</div>
<!-- /stats --> 


<asp:Literal ID="ltMessage" runat="server"/>
<!-- /message --> 

<div class="widget" style="margin-top: 20px">       
    <ul class="tabs">
        <li id="tab8"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsPublished.ToString()) %>">Bài đã duyệt</a></li>
        <li id="tab2"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, Core.Library.Status.IsWaitingForPublish.ToString()) %>">Bài chờ duyệt</a></li>       
        <li id="tab32"><a href="<%= UrlHelpers.CreateQA(Url) %>">Tạo bài mới</a></li>        
    </ul>
            
    <div class="tab_container">
        <div class="tab_content">            
            <div class="floatright">
                <asp:Button ID="btnPublish" Text="Duyệt bài"         ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnPublish" runat="server"/>
                <asp:Button ID="btnRemove"  Text="Gỡ bài"     ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 redBtn" OnClick="BtnRemove" runat="server"/>                                                   
                <asp:Button ID="btnDelete"  Text="Xóa bài"     ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 redBtn" OnClick="BtnDelete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');" runat="server"/>                                                   
            </div>
            <div class="fix"></div>
                        
            <asp:ListView ID="lvList" DataKeyNames="QA_ID" OnItemDataBound="lvList_ItemDataBound"  runat="server">
            <LayoutTemplate>
                <div class="widget" style="margin-top: 10px">                                	 
                <table id="grdList" width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
            	<thead>
                	<tr>
                        <td class="pl10 w30"><input id="cbAll" type="checkbox" onclick="selectAllRows(this);"/></td>
                        <td class="w45">STT</td>                        
                        <td>Câu hỏi</td>
                        <td class="w140">Email</td> 
                        <td class="w125">Ngày gửi</td>                                          
                        <td class="w60"></td>           
                        <td class="w100">Thao tác</td>           
                    </tr>
                </thead>                
                <tbody>
                    <tr id="itemPlaceHolder" runat="server"></tr>                	
                </tbody>
                </table>
                </div>
            </LayoutTemplate>                        
            <ItemTemplate>
                <tr id="<%# ((QAObject)Container.DataItem).QA_ID %>-list">
                    <td class="aligncenter"><asp:CheckBox ID="cbItem" ClientIDMode="Static" runat="server"/></td>                                        
                    <td class="aligncenter"><%# Utils.GetStt(ConvertUtility.ConvertTo<int>(Container.DataItemIndex), PageIndex, PageSize)%></td>                                        
                    <td>
                        <a href="<%# UrlHelpers.EditQA(((QAObject)Container.DataItem).QA_ID.ToString(), Url) %>">
                            <%# ((QAObject)Container.DataItem).QA_Text %></td>                             
                        </a>
                    </td>                         
                    <td class="aligncenter"><%# ((QAObject)Container.DataItem).QA_Email %></td> 
                    <td class="aligncenter"><%# DateTimeFunctions.FormatIn_HHMM_DDMMYYYY(ConvertUtility.ToDateTime(((QAObject)Container.DataItem).QA_CreatedDate))%></td>                        
                    <td class="aligncenter"><asp:Literal ID="ltImage" runat="server" /></td>
                    <td class="aligncenter">
                        <a class="btn14 topDir" title="Sửa" href="<%# UrlHelpers.EditQA(((QAObject)Container.DataItem).QA_ID.ToString(), Url) %>">
                            <img src="/images/icons/dark/pencil.png" alt=""/>
                        </a>                            
                        <a class="btn14 topDir ml5" onclick="preview(<%# ((QAObject)Container.DataItem).QA_ID %>, 'QA');" title="Xem trước">
                            <img src="/images/icons/dark/view.png" alt=""/>
                        </a>
                    </td>                      
                </tr>
                <asp:HiddenField ID="hfIsFeature" Value='<%# ((QAObject)Container.DataItem).QA_IsFeature %>' runat="server"/>                              	  
            </ItemTemplate>
            <EmptyDataTemplate>
                <div style="width: 99%; margin: auto; padding-top: 5px;"><%= MessageUtility.NoData %></div>
            </EmptyDataTemplate>
            </asp:ListView>
            <!-- /list -->                         

            <div class="body clear mb22">
                <div class="floatleft">
                    <label>Số bản ghi / trang:</label>
                    <asp:DropDownList ID="ddlPageSize" runat="server" Width="60" AutoPostBack="True" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">                        
                        <asp:ListItem Text="20" Value="20" />                        
                        <asp:ListItem Text="40" Value="40" />                        
                        <asp:ListItem Text="60" Value="60" />                        
                        <asp:ListItem Text="80" Value="80" />                        
                        <asp:ListItem Text="100" Value="100" />                                                
                    </asp:DropDownList>
                </div>

                <div class="pagination floatright">
			        <ul class="pages">
                        <asp:Literal ID="ltPager" runat="server" />
			        </ul>
		        </div>                               
            </div>
            <div class="fix"></div>	 
            <!-- /pager -->  
                      
        </div>        
    </div>	
    <div class="fix"></div>	 
</div>
<!-- /tabs two zodiac -->

<script type="text/javascript">
    activeTab('<%= Tab %>');
</script>
